<template>
  <div id="app">
    <!-- 按钮 -->
    <el-row>
      <el-button>默认按钮</el-button>
      <el-button type="primary" round>主要按钮</el-button>
      <el-button type="success">成功按钮</el-button>
      <el-button type="info">信息按钮</el-button>
      <el-button type="warning">警告按钮</el-button>
      <el-button type="danger">危险按钮</el-button>
      <el-button type="primary" icon="el-icon-edit" circle></el-button>
      <el-button type="danger" icon="el-icon-delete" size="small"></el-button>
    </el-row>

    <!-- 输入框 -->
    <el-row>
      <el-input v-model="username" placeholder="请输入用户名"></el-input>
    </el-row>
    <hr>

    <!-- 表单 -->
    <el-form ref="form" :model="user" label-width="80px" style="width: 500px;">
      <el-form-item label="姓名">
        <el-input v-model="user.name"></el-input>
      </el-form-item>
      <el-form-item label="电话">
        <el-input v-model="user.phone"></el-input>
      </el-form-item>
      <el-form-item label="地址">
        <el-input v-model="user.address"></el-input>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="addUser">添加</el-button>
      </el-form-item>
    </el-form>


  </div>
</template>

<script>
import HelloWorld from './components/HelloWorld.vue'

export default {
  name: 'app',
  components: {
    HelloWorld
  },
  data() {
    return {
      username: '',
      user: {
        name: '',
        phone: '',
        address: ''
      },
    }
  },
  methods: {
    addUser(){
      console.log(this.user)
    }
  }
}
</script>

<style>
#app {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
